DefaultOpenExtensionPopupCallback

class DefaultOpenExtensionPopupCallback(popups: <Error class: unknown class><PopupWindowState>, scope: <Error class: unknown class>) : OpenExtensionPopupCallback

The default OpenExtensionPopupCallback implementation that creates and shows a new window with the content of the extension popup.

The created popup becomes visible when it is added to the observable popups list and disappears when it is removed from the list. Please make sure, the used popups list is passed to BrowserView.

An example usage:

val browser = remember { engine.newBrowser() }
val popups = remember { mutableStateListOf<PopupWindowState>() }
val scope = rememberCoroutineScope()

BrowserView(browser, popups = popups)

// After one or more extensions are installed.
LaunchedEffect(Unit) {
browser.profile.extensions().list().forEach {
it.register<OpenExtensionPopupCallback>(
DefaultOpenExtensionPopupCallback(popups, scope)
)
}
}

Parameters

popups

An observable list of open popups.

scope

The coroutine scope used to launch coroutines for updating the popups.

Constructors

Link copied to clipboard
constructor(popups: <Error class: unknown class><PopupWindowState>, scope: <Error class: unknown class>)

Functions

Link copied to clipboard

Invoked when the callback needs a response for the given callback parameters. The response can be provided asynchronously from a different thread or before the method returns. The response can be provided only once.